﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductSearchModels>" %>
<div class="clear"></div>
<%var path = "/product/index/{0}/{1}/{2}/{3}/{4}"; %>
<div class="path">
    <a href="/home">Trang chủ</a>
    <%if (Model.SellID <= 0)
      { %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <a href="/product">Sản phẩm</a>
    <%}
      else
      { %>
      <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
      <%var l1 = "/product/index/0/0/0/0/0/"+Model.SellID.Value; %>
      <a href="<%=l1 %>"><%= Html.Encode(Model.Sells[Model.SellID.Value])%></a>
    <%} %>
    <%if(Model.ProductType != null){ %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <%var l1 =SDT.Lib.Helpers.TextHelper.ToUrlShort(string.Format(path, Model.TypeID.HasValue ? Model.TypeID.Value : 0, 0, 0, 0, 0)); %>
    <a href="<%=l1 %>"><%= Html.Encode(Model.ProductType.Name)%></a>
    <%} %>
    <%if(Model.Category != null){ %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <%var l2 =SDT.Lib.Helpers.TextHelper.ToUrlShort( string.Format(path,Model.TypeID.HasValue ? Model.TypeID.Value : 0,0, Model.CategoryID.HasValue ? Model.CategoryID.Value : 0, 0, 0)); %>
    <a href="<%=l2 %>"><%= Html.Encode(Model.Category.Name)%></a>
    <%} %>
    <%if(Model.ProductHoliday != null){ %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <%var l2 =SDT.Lib.Helpers.TextHelper.ToUrlShort( string.Format(path,Model.TypeID.HasValue ? Model.TypeID.Value : 0,0, Model.CategoryID.HasValue ? Model.CategoryID.Value : 0, Model.ProductHoliday.ID, 0)); %>
    <a href="<%=l2 %>"><%= Html.Encode(Model.ProductHoliday.Name)%></a>
    <%} %>
    <%if(Model.Event != null){ %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <%var l2 =SDT.Lib.Helpers.TextHelper.ToUrlShort( string.Format(path,Model.TypeID.HasValue ? Model.TypeID.Value : 0,0, Model.CategoryID.HasValue ? Model.CategoryID.Value : 0, Model.HolidayID, Model.Event.ID)); %>
    <a href="<%=l2 %>"><%= Html.Encode(Model.Event.Title)%></a>
    <%} %>
    <%if(Model.ConvertPrice != null){ %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <%var l6 =SDT.Lib.Helpers.TextHelper.ToUrlShort(string.Format(path,Model.TypeID,Model.PriceID, Model.CategoryID, 0,0)); %>
    <a href="<%=l6 %>">Giá&nbsp;<%= Html.Encode(Model.ConvertPrice.Name)%></a>
    <%} %>
    <%if(Model.Tag != null){ %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <%var l6 ="/product/listtag/"+Model.Tag.ID; %>
    <a href="<%=l6 %>"><%= Html.Encode(Model.Tag.Keyword)%></a>
    <%} %>
    <%if(Model.PathTitle != null && Model.PathTitle !=string.Empty){ %>
    <img src="/images/mq/icon-16-path.png" width="16" height="16" style="vertical-align:middle" />
    <%= Html.Encode(Model.PathTitle)%>
    <%} %>
    
</div>
<div class="line"></div>